#pragma once
#include <Engine/Renderer/RendererEnums.h>
#include <d3d11.h>
namespace fastbird
{
	//------------------------------------------------------------------------
	inline D3D11_USAGE ConvertEnumD3D11(BUFFER_USAGE usage)
	{
		return D3D11_USAGE(usage);
	}

	//------------------------------------------------------------------------
	inline D3D11_CPU_ACCESS_FLAG ConvertEnumD3D11(BUFFER_CPU_ACCESS_FLAG flag)
	{
		return D3D11_CPU_ACCESS_FLAG(flag);
	}

	//------------------------------------------------------------------------
	inline unsigned int ConvertEnumD3D11(MAP_FLAG flag)
	{
		switch(flag)
		{
		case 0:
			return 0;

		case MAP_FLAG_DO_NOT_WAIT:
			return D3D11_MAP_FLAG_DO_NOT_WAIT;

		default:
			assert(0);
			return 0;
		}
	}

	//------------------------------------------------------------------------
	inline D3D11_MAP ConvertEnumD3D11(MAP_TYPE type)
	{
		return D3D11_MAP(type);
	}

	//------------------------------------------------------------------------
	inline D3D11_FILL_MODE ConvertEnumD3D11(FILL_MODE mode)
	{
		return D3D11_FILL_MODE(mode);
	}

	//------------------------------------------------------------------------
	inline D3D11_CULL_MODE ConvertEnumD3D11(CULL_MODE mode)
	{
		return D3D11_CULL_MODE(mode);
	}

	//------------------------------------------------------------------------
	inline D3D11_FILTER ConvertEnumD3D11(TEXTURE_FILTER filter)
	{
		return D3D11_FILTER(filter);
	}

	//------------------------------------------------------------------------
	inline D3D11_TEXTURE_ADDRESS_MODE ConvertEnumD3D11(TEXTURE_ADDRESS_MODE mode)
	{
		return D3D11_TEXTURE_ADDRESS_MODE(mode);
	}

	//------------------------------------------------------------------------
	inline D3D11_COMPARISON_FUNC ConvertEnumD3D11(COMPARISON_FUNC func)
	{
		return D3D11_COMPARISON_FUNC(func);
	}

	//------------------------------------------------------------------------
	inline D3D11_BLEND ConvertEnumD3D11(BLEND b)
	{
		return D3D11_BLEND(b);
	}

	//------------------------------------------------------------------------
	inline D3D11_BLEND_OP ConvertEnumD3D11(BLEND_OP bo)
	{
		return D3D11_BLEND_OP(bo);
	}

	//------------------------------------------------------------------------
	inline D3D11_COLOR_WRITE_ENABLE ConvertEnumD3D11(COLOR_WRITE_ENABLE c)
	{
		return D3D11_COLOR_WRITE_ENABLE(c);
	}
}